import { instance } from "./request";

//获取店铺列表
export const getShopList = () => {
  return instance({
    url: "/Coupang.Common/shopList",
    method: "get",
  });
};

//获取店铺列表
export const getItemList = (data) => {
  return instance({
    url: "/Coupang.SkuItem/itemList",
    method: "post",
    data,
  });
};
//同步SKU
export const refreshSKU = (data) => {
  return instance({
    url: "/Coupang.Product/sync",
    method: "post",
    data,
  });
};

export const getFieldList = (data) => {
  return instance({
    url: "/Sku/getFieldList",
    method: "post",
    data,
  });
};
export const getSkuFieldList = (data) => {
  return instance({
    url: "/SkuItem/getFieldList",
    method: "post",
    data,
  });
};

//SKU组预报号码
export const getSkuNumber = (data) => {
  return instance({
    url: "/Coupang.SkuItem/getUpdateInfo",
    method: "post",
    data,
  });
};
//添加SKU组
export const addSkuArray = (data) => {
  return instance({
    url: "/Coupang.SkuItem/skuList",
    method: "post",
    data,
  });
};

//提交SKU组
export const pullSku = (data) => {
  return instance({
    url: "/Coupang.SkuItem/pullSku",
    method: "post",
    data,
  });
};

//选择SKU组
export const chooseSku = (data) => {
  return instance({
    url: "/SkuItem/chooseSku",
    method: "post",
    data,
  });
};

export const updateSku = (data) => {
  return instance({
    url: "/Coupang.SkuItem/updateSkuItem",
    method: "post",
    data,
  });
};

export const skuListDel = (data) => {
  return instance({
    url: "/Coupang.SkuItem/skuListDel",
    method: "post",
    data,
  });
};

export const delSku = (data) => {
  return instance({
    url: "/Coupang.SkuItem/delSku",
    method: "post",
    data,
  });
};

//修改前请求
export const getItemUpdateInfo = (data) => {
  return instance({
    url: "/Coupang.SkuItem/getItemUpdateInfo",
    method: "post",
    data,
  });
};
//提交修改
export const itemUpdateInfo = (data) => {
  return instance({
    url: "/Coupang.SkuItem/itemUpdateInfo",
    method: "post",
    data,
  });
};

//SKU组列表获取
export const getSkuItemList = (data) => {
  return instance({
    url: "/SkuItem/skuItemList",
    method: "post",
    data,
  });
};

//选择SKU后的预览列表
//
export const addSkuItem = (data) => {
  return instance({
    url: "/SkuItem/addSkuItem",
    method: "post",
    data,
  });
};
//预览
export const skuPreview = (data) => {
  return instance({
    url: "/Sku/skuPreview",
    method: "post",
    data,
  });
};
//下拉接口
export const getSkuList = () => {
  return instance({
    url: "/Sku/getFieldList",
    method: "get",
  });
};

//SKU组合列表
export const getSkuItemNo = () => {
  return instance({
    url: "/SkuItem/skuItemNo",
    method: "get",
  });
};
//删除SKU预览
export const skuPreviewDel = (data) => {
  return instance({
    url: "/SkuItem/skuPreviewDel",
    method: "post",
    data,
  });
};

//删除SKU组
export const delSkuItem = (data) => {
  return instance({
    url: "/SkuItem/delSkuItem",
    method: "post",
    data,
  });
};

//修改前获取
export const getUpdateInfo = (data) => {
  return instance({
    url: "/SkuItem/getUpdateInfo",
    method: "post",
    data,
  });
};

//修改提交
export const updateSkuItem = (data) => {
  return instance({
    url: "/SkuItem/updateSkuItem",
    method: "post",
    data,
  });
};

//关联SKU->新建SKU
export const addSku = (data) => {
  return instance({
    url: "/Sku/add",
    method: "post",
    data,
  });
};

//修改收货人信息
export const upOrderer = (data) => {
  return instance({
    url: "/Coupang.Order/upOrderer",
    method: "post",
    data,
  });
};
//添加国际快递单号
export const add_waybillNo = (data) => {
  return instance({
    url: "/Coupang.Order/waybillNo",
    method: "post",
    data,
  });
};

///Coupang订单下单
export const placeOrder = (data) => {
  return instance({
    url: "/Coupang.Order/placeOrder",
    method: "post",
    data,
  });
};
